<!DOCTYPE composition PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 
	"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<ui:composition xmlns="http://www.w3.org/1999/xhtml"
	xmlns:s="http://jboss.com/products/seam/taglib"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:rich="http://richfaces.org/rich"
	template="/layout/template.xhtml">

	<ui:define name="body">

		<h:messages globalOnly="true" styleClass="message" errorClass="errormsg" infoClass="infomsg" warnClass="warnmsg"/>
		
		<h:form id="courseInfo" styleClass="edit">
			<rich:panel>
				<f:facet name="header">Course information</f:facet>

				<s:decorate id="nameField" template="/layout/edit.xhtml">
					<ui:define name="label">Name</ui:define>
					<h:inputText id="name" required="true"
						value="#{newCourse.name}"/>
				</s:decorate>

				<s:decorate id="numHolesField" template="/layout/edit.xhtml">
						<ui:define name="label"># of holes</ui:define>
						<h:selectOneMenu id="numHoles" required="true"
							value="#{newCourse.numHoles}">
							<f:selectItem itemValue="9"/>
							<f:selectItem itemValue="18"/>
						</h:selectOneMenu>
				</s:decorate>

        <ui:remove>
				<s:decorate id="numTeeSetsField" template="/layout/edit.xhtml">
						<ui:define name="label"># of tee sets</ui:define>
						<h:inputText id="numTeeSets" required="true"
							value="#{courseWizard.numTeeSets}">
						</h:inputText>
				</s:decorate>
        </ui:remove>

				<s:decorate id="fairwaysField" template="/layout/edit.xhtml">
						<ui:define name="label">Grass type (fairways)</ui:define>
						<h:inputText id="fairways" 
							value="#{newCourse.fairways}">
						</h:inputText>
				</s:decorate>

				<s:decorate id="greensField" template="/layout/edit.xhtml">
						<ui:define name="label">Grass type (greens)</ui:define>
						<h:inputText id="greens" 
							value="#{newCourse.greens}">
						</h:inputText>
				</s:decorate>

				<s:decorate id="designerField" template="/layout/edit.xhtml">
						<ui:define name="label">Designer</ui:define>
						<h:inputText id="designer" 
							value="#{newCourse.designer}">
						</h:inputText>
				</s:decorate>
				<s:decorate id="yearBuiltField" template="/layout/edit.xhtml">
						<ui:define name="label">Year built</ui:define>
						<h:inputText id="yearBuilt"
							value="#{newCourse.yearBuilt}">
						</h:inputText>
				</s:decorate>
				
				<div style="clear:both">
					<span class="required">*</span> required fields
				</div>
			</rich:panel>
			<div class="actionButtons">
				<s:button id="cancel" action="cancel" value="Cancel"/>
				<h:commandButton id="next" action="next" value="Next &gt; &gt;"/>
			</div>
		</h:form>
		<p>
			<h:form id="workspaceSwitcher">
				<strong style="color: #000000;">Workspace: </strong>
				<h:selectOneMenu id="target" value="#{switcher.conversationIdOrOutcome}" style="vertical-align: bottom;">
					<f:selectItem itemLabel="Return home" itemValue="home"/>
					<ui:remove><f:selectItem itemLabel="Enter new course" itemValue="addCourse"/></ui:remove>
					<f:selectItems value="#{switcher.selectItems}"/>
				</h:selectOneMenu>
				<h:commandButton id="switch" action="#{switcher.select}" value="Switch" style="margin: 0 0 0 3px;">
					<s:conversationPropagation type="none"/>
				</h:commandButton>
				<!-- make the add course button of the conversation switcher is very complicated -->
				<s:button id="addCourse" action="#{courseWizard.addCourse}" propagation="none" value="Add course...">
          			<f:param name="facilityId" value="#{newCourse.facility.id}"/>
        		</s:button>
			</h:form>
		</p>

	</ui:define> 
</ui:composition>
